package com.eascs.credit.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eascs.admin.common.dao.BaseO2oDao;
import com.eascs.credit.entity.CreditResolve;

/**
 * 征信Dao
 * @author ycz
 *
 */
@Repository
public class O2oCreditDao extends BaseO2oDao{
	
	public List<CreditResolve> queryBillCode(){
		String sql="SELECT t.loanapply_no,t.bill_code,t.wf_type as status,t.loan_id,t.ltd_name,u.customer_name,o.province_name,f.urlpath as url FROM"
				+ " o2o_loanapply t LEFT JOIN o2o_loan_user u ON t.loanapply_no = u.loanapply_no"
				+ " AND u.loan_id = t.loan_id AND u.spouse_id IS NULL AND u.sponsor_type IS NULL"
				+ " LEFT JOIN o2o_platform_regional o ON t.ltd=o.platform_id LEFT JOIN o2o_datalist f ON "
				+ " f.loanapply_no=t.loanapply_no AND f.datalist_code='ZXBGDATA' "
				+ " WHERE t.wf_type IN ('YQ', 'DC', 'O', 'HN')";
		return super.findEntitys(sql, CreditResolve.class);
	}

	public CreditResolve getByLoanapplyNo(String loanapplyNo) {
		String sql="SELECT * from o2o_credit_resolve t where t.loanapply_no=?";
		return super.findEntity(sql, CreditResolve.class, loanapplyNo);
	}
}
